﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Reflection;

namespace DALFactory
{
    public class DataAccess
    {
        private static readonly string dalPath = ConfigurationManager.AppSettings["iBookShopDAL"];
        public static IDAL.IBook CreateBookDAL()
        {
            string className = dalPath + ".Book";
            return (IDAL.IBook)Assembly.Load(dalPath).CreateInstance(className);
        }
        public static IDAL.IOrder CreateOrderDAL()
        {
            string className = dalPath + ".Order";
            return (IDAL.IOrder)Assembly.Load(dalPath).CreateInstance(className);
        }
    }
}
